package com.mapproject.industrymap.controller;

import com.mapproject.industrymap.service.SysAutoPublishService;
import com.mapproject.industrymap.utils.ReturnValue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/server")
public class AutoPublishController {
    @Autowired
    SysAutoPublishService sysAutoPublishService;

    @RequestMapping("/publish")
    public ReturnValue getAutoPublishInfo(@RequestParam(value = "layername")String layername){
        return new ReturnValue(200,"成功发布图层",sysAutoPublishService.autoPublish(layername)) ;
    }
    @RequestMapping("/publishdxf")
    public ReturnValue getAutoPublishDxfInfo(@RequestParam(value = "layername")String layername){
        return new ReturnValue(200,"成功发布图层",sysAutoPublishService.autoPublishDxf(layername)) ;
    }
    @RequestMapping("/publishjson")
    public ReturnValue getAutoPublishGeojsonInfo(@RequestParam(value = "layername")String layername){
        return new ReturnValue(200,"成功发布图层",sysAutoPublishService.autoPublishGeojson(layername)) ;
    }
}
